package com.usercar.service.impl;

import com.usercar.pojo.Displacement;
import com.usercar.mapper.DisplacementMapper;
import com.usercar.service.IDisplacementService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author ${author}
 * @since 2021-08-14
 */
@Service
public class DisplacementServiceImpl extends ServiceImpl<DisplacementMapper, Displacement> implements IDisplacementService {

    @Autowired
    private DisplacementMapper displacementMapper;
    @Override
    public Displacement selectByType(String type) {
        Map<String,Object> map = new HashMap<>();
        map.put("type",type);
        Displacement d = displacementMapper.selectByMap(map).get(0);
        return d;
    }
}
